<% content_for :title, t(:shared_files) -%>

<h1><%= content_for :title %></h1>

<table>
  <tr>
    <th></th>
    <th><%= t('activerecord.models.user_file') %></th>
    <th><%= t(:shared_by) %></th>
    <th><%= t('activerecord.attributes.share_link.emails') %></th>
    <th><%= t('activerecord.attributes.share_link.expires_at') %></th>
    <th></th>
  </tr>
<% @share_links.each do |share_link| -%>
  <tr class="<%= cycle('even','odd') %>">
    <td><%= image_tag file_icon(share_link.user_file.extension) %></td>
    <td class="file_name"><%= link_to truncate(share_link.user_file.attachment_file_name, :length => 24), share_link.user_file.folder, :title => "#{share_link.user_file.attachment_file_name} (#{share_link.user_file.folder.name})" %></td>
    <td><%= share_link.user.name %></td>
    <td><span class="share_link_emails" title="<%= share_link.emails %>"><%= truncate(share_link.emails, :length => 36) %></td>
    <td><%= l share_link.link_expires_at, :format => :very_short %></td>
    <td><%= link_to image_tag('delete.png', :alt => t(:delete_item)), share_link_path(share_link), :method => :delete, :data => { :confirm => t(:are_you_sure) }, :title => t(:unshare) %></td>
  </tr>
<% end -%>
</table>
